using UnityEngine;

public abstract class Enemy : Entity
{
    [Header("Enemy")]
    [SerializeField] LayerMask playerLayer;
    [SerializeField] float playerCheckDistance;

    // ========================================================================

    protected override void OnDrawGizmos()
    {
        base.OnDrawGizmos();

        Gizmos.color = Color.yellow;
        Gizmos.DrawLine(transform.position, new Vector3(transform.position.x + GetAttackRange() * FacingDirection(), transform.position.y));
    }

    // ========================================================================

    public abstract float GetAttackRange();

    public RaycastHit2D PlayerDetected() => Physics2D.Raycast(wallCheckPoint.position, Vector2.right * FacingDirection(), playerCheckDistance, playerLayer);
}
